package cn.edu.scau.cmi.wujiaxian.exercise4;

public class Perfect_number {
	public static void main(String[] args) {
		int x, i;
		System.out.println("2000以内的完美数有:");
		for (x = 1; x <= 2000; x++) {
			int sum = 0;
			for (i = 1; i < x; i++) {
				if (x % i == 0) {
					sum = sum + i;
				}
			}
			if (sum == x)
				System.out.println(x + ",");
		}
	}
}
